Skip to content

[darwin]: wrap library functions as struct methods#1976

Merged
shirou merged 1 commit intoshirou:masterfrom
uubulb:refactor/wrap-library-functions
Dec 28, 2025
Merged

[darwin]: wrap library functions as struct methods#1976
shirou merged 1 commit intoshirou:masterfrom
uubulb:refactor/wrap-library-functions

Conversation

@uubulb
Copy link
Copy Markdown
Contributor

@uubulb uubulb commented Dec 19, 2025

Library is now a private struct, used to compose new structs representing different system libraries/frameworks: CoreFoundationLib, IOKitLib, and SystemLib. Each of them provides public methods that directly register and call the underlying library functions, improving readability by eliminating the need to use GetFunc in other packages.

A temporary cache fnMap is added to the Library struct to ensure the same lazy loading behavior as before.

Note: This PR contains changes from #1971 and #1973, so it has lower review priority than those. These changes are included here to make upcoming conflict fixing easier.

@uubulb uubulb force-pushed the refactor/wrap-library-functions branch from df90dba to edba8ea Compare December 25, 2025 13:52
@uubulb uubulb marked this pull request as ready for review December 25, 2025 13:58
Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good refactoring. LGTM! Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants